package jgl.vajra.management.view.bulletChat;

import java.math.BigDecimal;

/**
 * Created by dell on 2016/9/28.
 */
public class Danmu {
    private String headerUrl;//头像
    private String userName;//昵称
    private String info;//信息
    private BigDecimal amount;//价格
    private String logo;//车架号

    public String getHeaderUrl() {
        return headerUrl;
    }

    public void setHeaderUrl(String headerUrl) {
        this.headerUrl = headerUrl;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }
}



/*public class MainActivity extends AppCompatActivity {
    DanmuView mDanmuView;
    EditText mMsgEdt;
    Button mSendBtn;
    Handler mDanmuAddHandler;
    boolean continueAdd;
    int counter;

    @Override
    protected void onResume() {
        super.onResume();
        mDanmuView.startPlay(true);//true表示弹幕的垂直方向是固定的,false则随机
        continueAdd = true;
        mDanmuAddHandler.sendEmptyMessageDelayed(0, 6000);
    }

    @Override
    protected void onPause() {
        super.onPause();
        continueAdd = false;
        mDanmuAddHandler.removeMessages(0);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        initData();
        initListener();
    }

    private void initView() {
        mDanmuView = (DanmuView) findViewById(R.id.danmuView);
        mMsgEdt = (EditText) findViewById(R.id.edt_msg);
        mSendBtn = (Button) findViewById(R.id.btn_send);
    }

    private void initData() {
        List<Danmu> danmuList = new ArrayList<>();
        for (int i = 0; i < 3; i++) {
            Danmu danmu = new Danmu();
            danmu.setHeaderUrl("http://tupian.qqjay.com/tou3/2016/0725/cb00091099ffbf09f4861f2bbb5dd993.jpg");
            danmu.setUserName("Mr.chen" + i);
            danmu.setInfo("我是弹幕啊,不要问我为什么不可以那么长!!!");
            danmuList.add(danmu);
        }
        mDanmuView.add(danmuList);

        //下面是模拟每秒添加一个弹幕的过程
        HandlerThread ht = new HandlerThread("send danmu");
        ht.start();
        mDanmuAddHandler = new Handler(ht.getLooper()) {
            @Override
            public void handleMessage(Message msg) {
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        Danmu danmu = new Danmu();
                        danmu.setHeaderUrl("http://tupian.qqjay.com/tou3/2016/0803/87a8b262a5edeff0e11f5f0ba24fb22f.jpg");
                        danmu.setUserName("Mr.new" + (counter++));
                        danmu.setInfo("新的弹幕啊!!!新的弹幕啊!!!新的弹幕啊!!!新的弹幕啊!!!");
                        mDanmuView.add(danmu);
                    }
                });
                //继续添加
                if (continueAdd) {
                    sendEmptyMessageDelayed(0, 1000);
                }
            }
        };
    }

    private void initListener() {
        //手动添加
        mSendBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String msg = mMsgEdt.getText().toString().trim();
                if (TextUtils.isEmpty(msg)) {
                    Toast.makeText(MainActivity.this, "亲,你想发送什么啊?", Toast.LENGTH_SHORT).show();
                    return;
                }
                mMsgEdt.setText("");
                Danmu danmu = new Danmu();
                danmu.setHeaderUrl("http://img0.imgtn.bdimg.com/it/u=2198087564,4037394230&fm=11&gp=0.jpg");
                danmu.setUserName("I'am good man");
                danmu.setInfo("我是新人:" + msg);
                mDanmuView.add(danmu);
            }
        });
    }
}*/

